package net.steam.easyjoboa.biz.impl;

import java.util.List;

import net.steam.easyjoboa.biz.PositionBiz;
import net.steam.easyjoboa.dao.PositionDao;
import net.steam.easyjoboa.entity.Position;

public class PositionBizImpl implements PositionBiz{

	private PositionDao positionDao;
	
	public List<Position> getAllPosition() {
		return positionDao.find("From Position");
		
	}

	public Position getPositionById(Integer id) {
		return positionDao.findById(id);
	}

	public List<Position> findByDepartID(Integer id) {
		String hql = "From Position where department.departmentId = "+id;
		List<Position> positions = positionDao.find(hql);
		return positions;
	}
	
	public void setPositionDao(PositionDao positionDao) {
		this.positionDao = positionDao;
	}

}
